Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add angle function to NumPy Frontend #12552

Merged

Conversation

mattcrewe
Copy link
Contributor

No description provided.

@ivy-leaves ivy-leaves added NumPy Frontend Developing the NumPy Frontend, checklist triggered by commenting add_frontend_checklist Ivy Functional API labels Mar 16, 2023
@mattcrewe
Copy link
Contributor Author

Close #12541

@MuhammadSaeedBatikh
Copy link
Contributor

MuhammadSaeedBatikh commented Mar 17, 2023

Hi @mattcrewe, thanks for the PR.
np.angle computes the angle of a complex input, so I am not entirely sure of the reasoning behind the TODO you added. Could you please elaborate on this?
Otherwise, lgtm.

@mattcrewe
Copy link
Contributor Author

Hi @MuhammadSaeedBatikh.
While the angle function is intended to take complex numbers as input the np.angle function will accept integer and float numbers as input; the other backends also mirror this behaviour. I am currently not testing for cases outside complex numbers as the current frontend implementation is only suitable to handle complex inputs. I left it at this point as it matches the current solutions for the other backends.

@MuhammadSaeedBatikh
Copy link
Contributor

MuhammadSaeedBatikh commented Mar 17, 2023

Makes sense. But no need to worry about that as these dtype conversions (if supported) are handled by the backend functions anyway. I'm just gonna remove the comments/TODOs and merge the PR. Thanks.

@MuhammadSaeedBatikh MuhammadSaeedBatikh merged commit 3189bdf into ivy-llc:master Mar 17, 2023
@aryanxk02
Copy link
Contributor

Hello @mattcrewe and @MuhammadSaeedBatikh, I happened to spend some time working on this function because it was not marked 'completed' here: #1525. Later while going through the codebase, I realised that the code for angle() has already been pushed. Please do the needful. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ivy Functional API NumPy Frontend Developing the NumPy Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants